package com.fwtai.controller.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.service.web.ShareService;
import com.fwtai.tool.ToolClient;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 欢迎页统计
 * @作者 田应平
 * @版本 v1.0
 * @QQ号码 444141300
 * @创建日期 2021-07-21 17:49:27
 * @官网 <url>http://www.fwtai.com</url>
*/
@RestController
@RequestMapping("/share")
public class ShareController{

    @Resource
	private ShareService shareService;

    @PreAuthorize("hasAuthority('share_btn_getMyShareListInfo')")
    @GetMapping("/getMyShareListInfo")
    public void getMyShareListInfo(final HttpServletRequest request,final HttpServletResponse response){
        ToolClient.responseJson(shareService.getMyShareListInfo(new PageFormData(request)),response);
    }

    @PreAuthorize("hasAuthority('share_btn_getMyTeamTotal')")
    @GetMapping("getMyTeamTotal")
    public void getMyTeamTotal(final HttpServletResponse response){
        ToolClient.responseJson(shareService.getMyTeamTotal(),response);
    }
}